/* ====================================================================
 * (#)Header: WebServiceBean.java
 * (#)Revision: 
 * (#)Date Created: 02-Oct-09 12:40:15 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.ws.ejb;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebService;

import com.karolak.entity.Person;
import com.karolak.service.entity.PersonService;
import com.karolak.ws.EntityWebServiceSei;

/**
 * <code>WebServiceBean</code> is used to ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
@Stateless(name = "EntityWebServiceSei")
@WebService(serviceName = "EntityWebServiceSei", endpointInterface = "com.karolak.ws.EntityWebServiceSei")
@Remote(value = EntityWebServiceSei.class)
public class WebServiceBean implements EntityWebServiceSei {

	@EJB(beanName = "PersonService", beanInterface = PersonService.class)
	private PersonService personService;

	public Person findPerson(Integer id) {
		Person person = getPersonService().findById(id);
		return person;
	}

	public Person createPerson(Person person) {
		return getPersonService().create(person);
	}

	public List<Person> selectPerson() {
		return getPersonService().select();
	}

	public int selectPersonCount() {
		return getPersonService().selectCount();
	}

	// === get/set === //
	public PersonService getPersonService() {
		return personService;
	}

	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}
}
